Sprite Track Properties
In addition to defining properties for individual sprites, you can also define properties that apply to an entire sprite track. These properties may override default behavior or provide hints to the sprite media handler. The following sprite track properties are supported:
-
The
kSpriteTrackPropertyBackgroundColor
property specifies a background color for the sprite track. The background color is used for any area that is not covered by regular sprites or background sprites. If you do not specify a background color, the sprite track uses black as the default background color.
-
The
kSpriteTrackPropertyOffscreenBitDepth
property specifies a preferred bit depth for the sprite track's offscreen buffer. The allowable values are 8 and 16. To save memory, you should set the value of this property to the minimum depth needed. If you do not specify a bit depth, the sprite track allocates an offscreen buffer with the depth of the deepest intersecting monitor.
-
The
kSpriteTrackPropertySampleFormat
property specifies the sample format for the sprite track. If you do not specify a sample format, the sprite track uses the default format,
kKeyFrameAndSingleOverride
.
To specify sprite track properties, you create a single QT atom container and add a leaf atom for each property you want to specify. To add the properties to a sprite track, you call the new media handler function
SetMediaPropertyAtom
. To retrieve a sprite track's properties, you call the media handler function
GetMediaPropertyAtom
.
The sprite track properties and their corresponding atom data are outlined in
Table 1
.
Table 1
Sprite track properties
Atom type
|
Atom ID
|
Leaf data type
|
kSpriteTrackPropertyBackgroundColor
|
1
|
RGBColor
|
kSpriteTrackPropertyOffscreenBitDepth
|
1
|
unsigned short
|
kSpriteTrackPropertySampleFormat
|
1
|
long
|
© 1997 Apple Computer, Inc.Previous | Chapter Top | Chapter Contents | Next